home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / mc51bugs / q32558 < prev    next >
Text File  |  1988-07-20  |  1KB  |  33 lines

  1. Q32558 Intrinsic outp with Conditional Operator (? :) May Fail
  2. C Compiler
  3. 5.10   | 5.10
  4. MS-DOS | OS/2
  5.  
  6. Summary:
  7.    When using the intrinsic version of outp with the conditional
  8. operator (?:), the compiler generates code that reverses the meaning
  9. of the code. For example, if i = 1 in the following code, outp
  10. is incorrectly called with 3 as the second argument instead of the
  11. expected 2:
  12.  
  13. #define PORT 0x123
  14. send(i)
  15. int i;
  16. {
  17. outp(PORT, (i == 1) ? 2 : 3);
  18. }
  19.  
  20.    Microsoft has confirmed this to be a problem in Version 5.10 of the
  21. C compiler. We are researching this problem and will post new
  22. information as it becomes available.
  23.    If you are using the conditional operator in calls to outp, you can
  24. work around this problem by using the function version of outp. You can
  25. also work around this problem by declaring a temporary variable,
  26. assigning to it the value of the conditional operator, and making the
  27. call with the temporary variable.
  28.  
  29.  
  30.  
  31. Keywords:  buglist5.10
  32. Updated  88/07/21 03:19
  33.